<%--
  @author Tharanga Punchihewa
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<div id="land-registration-module-home-title" class="module-home-title">
    <%--<s:a href="landAlienationModuleHome.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                                        alt="Land Registration"><span><s:label
            value="%{getText('land_alienation.label')}"/></span></s:a>
    <span class="module-title-breaker"> > </span>
    <s:a href="detailApplicationApprove.do">
        <img src="${pageContext.request.contextPath}/images/registration-form.png" alt="Land Registration">
        <span>
            <s:label value="%{getText('modify_detail_alienation_application.label')}"/>
        </span>
    </s:a>--%>

    <s:if test="#session.userGroup !='slc'">
        <s:include value="./alienationApplicationNavigationDetail.jsp"/>
    </s:if>

</div>
<s:if test="alienationAction == 1">
    <h2><s:label value="%{getText('interview_detail_alienation_application.label')}"/></h2>
</s:if>
<s:elseif test="alienationAction == 2">
    <h2><s:label value="%{getText('handling_objections.label')}"/></h2>
</s:elseif>
<s:else>
    <s:include value="./alienationApplicationHeadings.jsp"/>
</s:else>

<script type="text/javascript">
    $(document).ready(function() {
        $('.land-table').dataTable({
            "sPaginationType": "two_button",
            "bShowAll": true
        });
    });
</script>
<table class="width-100 margin-10-auto table land-table">
    <thead>
    <tr>
        <th><s:label value="%{getText('applied_date.label')}"/></th>
        <th><s:label value="%{getText('applicant_name.label')}"/></th>
        <th><s:label value="%{getText('action.label')}"/></th>
    </tr>
    </thead>
    <tbody>
    <s:iterator status="status1" value="landApplicationList">
        <tr>
            <td class="center-align"><s:property value="submitDate"/></td>
            <td class="center-align"><s:property value="holder.name"/></td>
            <td class="center-align">
                <s:if test="editMode == 4">

                    <s:url id="editInitApplication" action="interviewDetailedApplication">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{editInitApplication}" title="%{getText('interview_tooltip')}">
                        <img src="<s:url value='/images/registration-form.png'/>" border="none" width="25"
                             height="25"/>
                    </s:a>
                </s:if>
                <s:elseif test="editMode == 5">
                    <s:url id="handleObjections" action="objectionHandleDetailedApplication">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{handleObjections}" title="%{getText('handle_objections_tooltip')}">
                        <img src="<s:url value='/images/registration-form.png'/>" border="none" width="25"
                             height="25"/>
                    </s:a>
                </s:elseif>
                <s:elseif test="editMode == 6">
                    <s:url id="approveObjections" action="approveObjectionsDetailedApplication">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{approveObjections}" title="%{getText('approve_objections_tooltip')}">
                        <img src="<s:url value='/images/registration-form.png'/>" border="none" width="25"
                             height="25"/>
                    </s:a>
                </s:elseif>
                <s:elseif test="editMode == 7">
                    <s:url id="finalize" action="finalizeDetailedApplication">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{finalize}">
                        <img src="<s:url value='/images/modify-form.png'/>" border="none" width="25"
                             height="25"/>
                    </s:a>
                </s:elseif>

                <s:elseif test="editMode == 30">
                    <s:url id="approveSignDoc" action="approveSignDoc">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{approveSignDoc}">
                        <img src="<s:url value='/images/modify-form.png'/>" border="none" width="25"
                             height="25"/>
                    </s:a>
                </s:elseif>

                <s:elseif test="editMode == 31">
                    <s:url id="generateLetterOfConfirmation" action="generateLetterOfConfirmation">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{generateLetterOfConfirmation}">
                        <img src="<s:url value='/images/register-letter.jpg'/>" border="none" width="25"
                             height="25" title="Letter Of Confirmation"/>
                    </s:a>

                    <s:url id="setUpAction" action="setUpAction">
                        <s:param name="applicationId" value="id"/>
                    </s:url>
                    <s:a href="%{setUpAction}">
                        <img src="<s:url value='/images/icon_register.jpg'/>" border="none" width="25"
                             height="25" title="SetUp Action"/>
                    </s:a>

                    <s:url id="viewAlienationDoc" action="viewAlienationDoc">
                        <s:param name="applicationId" value="id"/>
                        <s:param name="editMode" value="32"/>
                    </s:url>
                    <s:a href="%{viewAlienationDoc}">
                        <img src="<s:url value='/images/agreement.png'/>" border="none" width="25"
                             height="25" title="View Alienation Doc"/>
                    </s:a>




                </s:elseif>


            </td>
        </tr>
    </s:iterator>
    </tbody>
</table>